package com.example.myapplication3.splash.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.example.myapplication3.R;
import com.example.myapplication3.fragment.SplashPage_1_Fragment;
public class SplashActivityAdapter extends FragmentStateAdapter {

    public SplashActivityAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        if (position==0){
            return SplashPage_1_Fragment.newInstance(R.drawable.ic_home_image,0xff008800,"掌控艺术像素的每一帧图片");
        }if (position==1){
            return SplashPage_1_Fragment.newInstance(R.drawable.ic_home_audio,0xff000088,"无损沉静全景环绕音乐");
        }
        return SplashPage_1_Fragment.newInstance(R.drawable.ic_home_doc,0xff008800,"至尊圣旨亲发文件");
    }

    @Override
    public int getItemCount() {
        return 3;
    }
}
